package date0708am;

public class StringBufferTest1 {

	public static void main(String[] args) {

		
		/*
		String s = "jdbc.connection.不知道什么数据库.username";
		StringBuffer usernameBuffer = new StringBuffer( s );
		int index = usernameBuffer.indexOf(".");
		int start = usernameBuffer.indexOf(".", index + 1);
		int end = usernameBuffer.lastIndexOf(".");
		usernameBuffer.delete(start + 1 , end); // [ start + 1 , end )
		*/
		
		final String s = "jdbc.connection..username";
		StringBuffer usernameBuffer = new StringBuffer( s );
		int last = usernameBuffer.lastIndexOf(".");
		usernameBuffer.insert( last , "oracle" );
		System.out.println(usernameBuffer );
	}

}
